import warnings
import numpy
import pandas
from scipy.interpolate import interp1d
from .dataResource import loadData

from typing import Any, Optional, List, Dict, Tuple, Set, Union

SoilClassification: Any
SoilBcOnNPrime: Any
SoilBcFactorsOnStrength: Any
PileSkinCapacity: Any
PileBaseCapacity: Any
SoilNailCohesion: Any

def cal_modified_character_bearing_capacity(fak: float, soil_type: int, gama: float, gama_m: float, f_width: float, f_depth: float, from_DPLT: bool = False) -> dict[str, float]:
    """
    Calculate the modified characteristic bearing capacity of the soil right below the foundation.
    
    Parameters
    ----------
    fak (kPa): float
        The standard value of the soil bearing capacity.
    
    soil_type: int
        The soil types of soil right below foundation to decide eta_b and eta_d. Below is the table for the normal soil type id:
        ```
        | 土的类别                           | ID  | eta_b  | eta_d  |
        |----------------------------------|------|------|------|
        | 淤泥和淤泥质土                     | 0    | 0    | 1    |
        | 人工填土，e或t大于等于0.85的黏性土 | 1    | 0    | 1    |
        | 红黏土，含水比 aw > 0.8           | 2    | 0    | 1.2  |
        | 红黏土，含水比 aw ≤ 0.8           | 3    | 0.15 | 1.4  |
        | 大面积压实填土，压实系数大于0.95，黏粒含量pc ≥ 10%的黏性土 | 4 | 0 | 1.5 |
        | 最大干密度大于2100kg/m³的级配砂石  | 5    | 0    | 2    |
        | 粉土，黏粒含量 pc ≥ 10%的粉性土    | 6    | 0.3  | 1.5  |
        | 粉土，黏粒含量 pc < 10%的粉性土     | 7    | 0.5  | 2    |
        | e及t均小于0.85的黏性土             | 8    | 0.3  | 1.6  |
        | 粉砂、细砂（不包括饱湿与饱和时的高密实状态） | 9 | 2 | 3 |
        | 中砂、粗砂、砾砂和碎石土           | 10   | 3    | 4.4  |
        | 非弱风化和全风化岩石               | 11   | 1    | 1    |
        ```
        For loess, here is the soil type table:
        ```
        | 土的类别                           | ID  | eta_b  | eta_d  |
        |----------------------------------|------|------|------|
        | 晚更新世、全新世湿陷性黄土，ω≤24%   | 12   | 0.2  | 1.25 |
        | 晚更新世、全新世湿陷性黄土，ω>24%   | 13   | 0    | 1.1 |
        | 新进堆积黄土                       | 14   | 0   | 1.0  |
        | 饱和黄土，e及IL都小于0.85          |  15  | 0.2  | 1.25 |
        | 饱和黄土，e或IL大于等于0.85        | 16   | 0    | 1.1 |
        | 饱和黄土，e及IL都不小于1.00        | 17   | 0    | 1.0 |
        ```
    
    gama (kN/m³): float
        The unit weight of the soil.
    
    f_width (m): float
        The width of the foundation.
    
    gama_m (kN/m³): float
        The unit weight of the fill.
    
    f_depth (m): float
        The depth of the foundation.
    
    from_DPLT: bool, default: False
        Whether the fak is from DPLT - Deep Plate Loading Test.
    
    Return
    ------
    dict[str, float]:
        `{fa: float, eta_b: float, eta_d: float}`
        fa (kPa): float
            The modified characteristic bearing capacity of the soil right below the foundation.
        eta_b: float
            The factor of foundation width to the soil bearing capacity.
        eta_d: float
            The factor of foundation depth to the soil bearing capacity.
    """
    ...

class SoilCapacityByExp:
    """Get soil capacity parameters according to experience and standards."""
    def __init__(self, material_name: str) -> Any:
        ...
    def cal_foot_capacity_fak(self, modified_spt_number: float) -> Any:
        """
        Calculate the footing soil bearing capacity according to standard - JGJ340-2015 - term 7.4.8
        
        Parameters
        ----------
        modified_spt_number : float
            The standard value of modified CPT number.
        
        Return
        ------
        Soil bearing capacity in units - kPa.
        If it's None, it means the soil bearing capacity cannot be calculated according to the standard.
        If it's a string, it means the value of soil bearing capacity it out of the range of the standard table.
        """
        ...
    def cal_foot_capacity_fa(cohesion: float, internal_friction_angle: float, unit_weight: float, saturate_unit_weight: float, underwater: bool = False, f_width: float = 0.3) -> float:
        """
        Calculate the footing soil bearing capacity according to standard - GB50007-2011 - term 5.2.5
        
        Parameters
        ----------
        cohesion: kPa, float
            Standard value of cohesion of the soil.
        
        internal_friction_angle: °, float
            Standard value of internal friction angle of the soil.
        
        unit_weight: kN/m3, float
            Average value of unit weight of the soil.
        
        saturate_unit_weight: kN/m3, float
            Average value of saturate unit weight of the soil.
        
        underwater: bool, default: False
            If it's True, the soil is underwater and saturate_unit_weight will be used.
        
        f_width: float, default: 0.3
            The width of the foundation.
        
        Note
        ----
        The depth of the foundation bottom is considered as 0.
        
        Return
        ------
        Soil bearing capacity in units - kPa.
        """
        ...
    def cal_pile_skin_capacity_qsik(self, liquid_index: Any = None, natural_water_content: Any = None, liquid_limit: Any = None, void_ratio: Any = None, spt_number: Any = None, dpt_number: Any = None, saturate_ucs: Any = None, ucs: Any = None) -> Any:
        """
        Calculate soil skin capacity of pile according to Chinese standard.
        
        Return
        ------
        dict[str, tuple[str, float]]:
            Key is the type of pile.
            For value, the first element is reference in string, the second element is suggested value.
            Pile skin capacity in units - kPa
        """
        ...
    def cal_pile_base_capacity_qpk(self, top_depth: float, bottom_depth: float, liquid_index: Any = None, void_ratio: Any = None, spt_number: Any = None, dpt_number: Any = None, saturate_ucs: Any = None, ucs: Any = None) -> Any:
        """
        Calculate soil skin capacity of pile according to Chinese standard.
        
        Return
        ------
        dict[str, tuple[str, float]]:
            Key is the type of pile.
            For value, the first element is reference in string, the second element is suggested value.
            Pile base capacity in units - kPa
        """
        ...
    def cal_soil_nail_cohesion_qsk(self, liquid_index: Any = None, spt_number: Any = None) -> Any:
        """
        Calculate soil nail limit cohesion qsk to Chinese standard.
        
        Return
        ------
        dict[str, tuple[str, float]]:
            Key is the type of pile.
            For value, the first element is reference in string, the second element is suggested value.
            Soil nail cohesion in units - kPa.
        """
        ...
